home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / MM3MCp.sea Folder / Made by Marksman / Sources / mm / mmCommonMM_Demo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-16  |  8.5 KB  |  175 lines  |  [TEXT/MMCC]

  1. /*  Copyright Â© 1994 George R. Cossey */
  2. /*   mmCommonMM_Demo                            Common and Utilitys
  3.  
  4.     Name:  mmCommonMM_Demo.h
  5.     Function:  Common for the Marksman™ specific code.
  6.     History: 1/16/94 Original by George Cossey
  7.  
  8. */
  9.  
  10. #include "mmTypesMM_Demo.h"
  11. #include "TypesMM_Demo.h"
  12.  
  13. /* ======================================================= */
  14. /* ======================================================= */
  15.  
  16. extern CApplication        *gApplication;                /* The application itself */
  17. extern CMenus            *gMenus;                    /* Menu handler */
  18. extern CPreferences        *gPreferences;                /* Preferences handler */
  19. extern CFiles            *gFiles;                    /* Files handler */
  20. extern CPrinting        *gPrinting;                    /* Printing handler */
  21.  
  22. extern UserEventHRec    UserEventList;                /* User Event record list start */
  23. extern EventRecord        myEvent;                    /* Event record for all events */
  24. extern Boolean            WNE;                        /* WaitNextEvent trap is available */
  25. extern short            SleepValue;                    /* Sleep value for Wait on events */
  26. extern Boolean            doneFlag;                    /* Exit program flag */
  27. extern TEHandle            theInput;                    /* Used in text edit selections */
  28. extern RgnHandle        cursorRgn;                    /* Cursor region for WaitNextEvent */
  29. extern short            ReplyMode;                    /* Reply mode for AppleEvents */
  30.  
  31. extern Rect                tempRect;                    /* Temporary rect, not for long term use */
  32. extern Str255            sTemp;                        /* Temporary string, not for long term use */
  33. extern short            tempChar;                    /* Temporary use character */
  34. extern long                LTemp;                        /* Temporary use long variable */
  35. extern short            DType;                        /* Temporary use Type of dialog item */
  36. extern Handle            DItem;                        /* Temporary use Handle to the dialog item */
  37. extern ControlHandle    CItem;                        /* Temporary use Control handle */
  38.  
  39. extern WindowLocRec        theWindowLocRec;
  40.  
  41. extern Boolean            Doing_MovableModal;            /* For Movable Modal dialogs */
  42. extern Boolean            HoldOffUserEvents;            /* Flag for holding off UserEvents */
  43. extern Boolean            InTheForeground;            /* Flag for running in MultiFinder foreground */
  44.  
  45. extern HasRec            Has;                        /* Gestalt check results */
  46.  
  47. extern RGBColor            Black_ForeColor,White_BackColor;/* Standard colors */
  48.  
  49. extern MenuHandle    Menu_Apple;                    /* Menu handle,  */
  50. extern MenuHandle    Menu_File;                    /* Menu handle, File */
  51. extern MenuHandle    Menu_Edit;                    /* Menu handle, Edit */
  52. extern MenuHandle    Menu_Windows;                    /* Menu handle, Windows */
  53.  
  54.  
  55. extern CmmAlert                    *gCurrentAlert;            /* The current Alert object */
  56. extern CAMy_Alert        *gMy_Alert;        /* The Alert object */
  57. extern CmmModalDialog            *gCurrentModalDialog;    /* The current Modal Dialog object */
  58. extern CDMy_Modal        *gMy_Modal;        /* The Modal Dialog object */
  59. extern CMDMy_Movable_Moda        *gMy_Movable_Moda;        /* The Modeless Dialog object */
  60. extern CMDMy_Modeless        *gMy_Modeless;        /* The Modeless Dialog object */
  61. extern CMDAbout_Demo        *gAbout_Demo;        /* The Modeless Dialog object */
  62. extern CWMy_basic_window        *gMy_basic_window;        /* The Window object that is active */
  63. extern CWFloating_window        *gFloating_window;        /* The Window object that is active */
  64.  
  65.  
  66. extern "C" {
  67.  
  68. /* Prototypes */
  69. pascal Boolean theAlertFilter (DialogPtr theDialog,EventRecord *theEvent,short *itemHit);
  70. pascal Boolean theModalDialogFilter(DialogPtr theDialog,EventRecord *theEvent,short *itemHit);
  71.  
  72. /* Copy Pascal strings */
  73. void PStrCopy(Str255 *SourceString, Str255 *DestString);
  74.  
  75. /* Concat Pascal strings */
  76. void PStrCat(Str255 *SourceString, Str255 *DestString);
  77.  
  78. /* Compare Pascal strings for exact match, case sensitive */
  79. Boolean PStrCmp(StringPtr Source1String,StringPtr Source2String);
  80.  
  81. WindowPtr Mk_BehindWindow(short theLayer);            /* Get which window to place us behind */
  82. void Mk_RegisterWindow(WindowPtr theWindowPtr,short theLayer);/* Place layer in RefCon and verify layers */
  83. void Mk_ClearLayers(void);                            /* Init our arrays for layered windows */
  84. void Mk_HiliteWindow(WindowPtr theWindowPtr);        /* Hilite our layered window */
  85. void Mk_DragWindow(WindowPtr theWindowPtr,Point where, Rect bounds);/* Drag our layered window */
  86. Boolean Mk_Is_FrontWindow(WindowPtr theWindowPtr);    /* Get the front window */
  87. void Mk_CloseLayeredWindow(WindowPtr theWindowPtr);/* Close a layered window */
  88.  
  89. void Play_The_Sound(short ResID);
  90.  
  91. void PositionWindow(WindowPtr theWindow,Point  WantLocation,Point DefaultPosition);
  92.  
  93. /* See if a trap is available */
  94. Boolean CheckTrapAvailable (short trapNumber, short tType);
  95.  
  96. /* See if any user events are available */
  97. void GetUserEvent(UserEventPRec TheUserEvent);
  98.  
  99. /* Add a user event */
  100. void Add_UserEvent(short ID, short ID2, long  Data1, long Data2, Handle  theHandle);
  101.  
  102. /* Set the title for a popup control */
  103. void SetNameForPopup(ControlHandle theControl);
  104.  
  105. /* This is a routine used to make a new list */
  106. void Make_A_List(ListHandle *theList,Rect *theListRect,WindowPtr theWindow,short theStringResourceID,
  107.     short theSize,short theFont,Style theStyle,Boolean InDialog);
  108.  
  109. /* This is a routine used to add strings to an existing list */
  110. void Add_List_String(Str255 theString, ListHandle theList, Point *cSize);
  111.  
  112. /* This is a routine used to get a string from a TE area, limited to 250 characters */
  113. void Get_TE_String(TEHandle theTEArea, Str255 *theString);
  114.  
  115. /* This is a routine used to create a TE area */
  116. void Make_TE_Area(TEHandle *theTEArea, Rect *Position,short theFontSize,short theFont,
  117.     short DefaultStringID);
  118.  
  119. /* This is a routine used to plot an Sicn, small 16x16 icon */
  120. void Plot_Sicn(short theSicnID, Rect *Position);
  121.  
  122. /* This is a routine used to handle a scrollbar */
  123. void HandleWScrollBar(Point myPt,short code,short Increment,short LIncrement,ControlHandle theControl);
  124.  
  125. /* Setup a dialog or alert item */
  126. void SetupTheItem (DialogPtr theDialog,short ItemID,Boolean SizeIt,Boolean ShowIt, 
  127.     Boolean EnableIt,Boolean SetTheMax,Rect *thePosition ,long ExtraData ,short StringID );
  128.  
  129. /* Center a window onto the deepest color screen */
  130. void CenterOnColorScreen(WindowPtr theWindow);
  131.  
  132. /* Get the deepest color screen rect */
  133. void GetDeepestColorScreenRect(Rect *DeepRect);
  134.  
  135. /* Alert and Dialog support routines */
  136. void HiliteDefaultButton(DialogPtr theDialog,short theItem);
  137. void CheckKeysInDialog(DialogPtr theDialog,Boolean *valMyFilter,EventRecord *theEvent,short *itemHit);
  138. void SetupNormalControl(DialogPtr theDialog,short theItem,Boolean Enabled,short InitialValue);
  139. void SetupHotSpot(DialogPtr theDialog,short theItem,Boolean MakeHotSpot,long LineWidth,
  140.     long ShadowWidth,short MessageResID,Boolean Enabled);
  141. void SetupPlugin(DialogPtr theDialog,short theItem,Boolean Enabled,
  142.     long NormalID,long HilitedID,short MessageResID);
  143. void SetupMinMaxValue(DialogPtr theDialog,short theItem,short min,short max,short value);
  144. void SetupPopupMenu(DialogPtr theDialog,short theItem,Boolean Enabled,short theMenuID,short value);
  145. void SetupPalette(DialogPtr theDialog,short theItem,Boolean Enabled,long NumberRows,long NumberCols,
  146.     long PalPictureID,long HiliteMethod);
  147. void SetupIconSicn(DialogPtr theDialog,short theItem,Boolean Enabled,
  148.     long NormalID,long HilitedID);
  149. void ClearTheRadio(DialogPtr theDialog,short theItem,short *value);
  150.  
  151. /* Window support routines */
  152. void DrawStaticTextBox(short ResID,Rect *theRect,short Justify,short theSize,short theFont,Style theStyle);
  153. void DrawStaticLine(short ResID,short Left,short Top,short theSize,short theFont,Style theStyle);
  154. void DrawTheTEArea(Rect *theTERect,TEHandle theTE,short theSize,short theFont,Style theStyle);
  155. ControlHandle MakeNormalControl(WindowPtr theWindow,short theResID,Boolean Enabled,short InitialValue);
  156. ControlHandle MakeHotSpot(WindowPtr theWindow,short theResID,Boolean MakeHotSpot,long LineWidth,
  157.     long ShadowWidth,short MessageResID,Boolean Enabled);
  158. ControlHandle MakeIconSicn(WindowPtr theWindow,short theResID,Boolean Enabled,
  159.     long NormalID,long HilitedID);
  160. ControlHandle MakePlugin(WindowPtr theWindow,short theResID,Boolean Enabled,
  161.     long NormalID,long HilitedID,short MessageResID,short InitialValue);
  162. void MakeMinMaxValue(ControlHandle theControl,short min,short max,short value);
  163. ControlHandle MakePopupMenu(WindowPtr theWindow,short theResID,Boolean Enabled,short theMenuID,short value);
  164. ControlHandle MakePalette(WindowPtr theWindow,short theResID,Boolean Enabled,long NumberRows,long NumberCols,
  165.     long PalPictureID,long HiliteMethod);
  166.  
  167. void UpdateTheList(RgnHandle theRgn,ListHandle theList,Rect *theRect,short theSize,short theFont,Style theStyle,Boolean InDialog);
  168. void ClickInTheList(Point myPt,short modifiers,ListHandle theList,short theSize,short theFont,Style theStyle,Boolean InDialog);
  169. void Activate_TE_Area(Boolean InDialog,Point myPt,TEHandle theTE,short textSize,short textFont,Style textStyle);
  170. }
  171.  
  172. /* ======================================================= */
  173. /* ======================================================= */
  174.  
  175.